import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.ParseException;
class Admin {
    private String username = "admin";
    private String password = "admin123"; // 固定管理员密码

    private List<User> users;  // 所有用户列表

    public Admin(List<User> users) {
        this.users = users;
    }


    public boolean login(String username, String password) {
        return this.username.equals(username) && this.password.equals(password);
    }

    public void approveUser(User user) {
        System.out.println("用户 " + user.name + " 已审核通过。");
    }

    public void confirmLoss(User user) {
        user.confirmLoss();
        System.out.println("用户 " + user.name + " 的校园卡已确认挂失。");
    }

    public void confirmRecovery(User user) {
        user.confirmRecovery();
        System.out.println("用户 " + user.name + " 的校园卡已确认解挂。");
    }


    public void showStatistics(List<User> users, Date startDate, Date endDate, String location) {
        System.out.println("消费统计：");
        for (User user : users) {
            user.showTransactions(startDate, endDate, location);
        }
    }
}